package com.yfw.maple_leaf_store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfw.maple_leaf_store.common.BaseContext;
import com.yfw.maple_leaf_store.domain.ShoppingCart;
import com.yfw.maple_leaf_store.domain.User;
import com.yfw.maple_leaf_store.mapper.ShoppingCartMapper;
import com.yfw.maple_leaf_store.mapper.UserMapper;
import com.yfw.maple_leaf_store.service.ShoppingCartService;
import com.yfw.maple_leaf_store.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author: yfw
 * @date: 2022/6/14 19:41
 * com.yfw.maple_leaf_store.service.impl
 */
@Service
public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService {
    @Override
    public void clean() {
        LambdaQueryWrapper<ShoppingCart> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ShoppingCart::getUid, BaseContext.getCurrentId());
        this.remove(queryWrapper);
    }
}
